package main

import "fmt"

func solution(values []int) int {
	// PLEASE DO NOT MODIFY THE FUNCTION SIGNATURE
	// write code here
	var score int
	for i := 0; i < len(values)-1; i++ {
		for j := 0; j < len(values); j++ {
			if j <= i {
				continue
			}
			if score < values[i]+values[j]+i-j {
				score = values[i] + values[j] + i - j
			}
		}
	}

	return score // Placeholder return
}

func main() {
	fmt.Println(solution([]int{8, 3, 5, 5, 6}) == 11)
	fmt.Println(solution([]int{10, 4, 8, 7}) == 16)
	fmt.Println(solution([]int{1, 2, 3, 4, 5}) == 8)
}
